/**
 * There are <a href="https://github.com/ketayao/keta-custom">keta-custom</a> code generation
 */
package fms.service.impl;

import java.util.List;

import fms.service.ServiceStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import fms.dao.ServiceStatusDAO;
import fms.entity.ServiceStatus;
import fms.service.ServiceStatusService;
import com.ketayao.ketacustom.util.dwz.Page;
import com.ketayao.ketacustom.util.dwz.PageUtils;

@Service
@Transactional
public class ServiceStatusServiceImpl implements ServiceStatusService {
 
	@Autowired
	private ServiceStatusDAO serviceStatusDAO;

	/*
	 * (non-Javadoc)
	 * @see com.adcc.skyfms.service.TaskService#get(java.lang.Long)  
	 */ 
	@Override
	public ServiceStatus get(Long id) {
		return serviceStatusDAO.findOne(id);
	}

	/*
	 * (non-Javadoc) 
	 * @see com.adcc.skyfms.service.TaskService#saveOrUpdate(com.adcc.skyfms.entity.Task)  
	 */
	@Override
	public void saveOrUpdate(ServiceStatus serviceStatus) {
		serviceStatusDAO.save(serviceStatus);
	}

	/*
	 * (non-Javadoc)
	 * @see com.adcc.skyfms.service.TaskService#delete(java.lang.Long)  
	 */
	@Override
	public void delete(Long id) {
		serviceStatusDAO.delete(id);
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.adcc.skyfms.service.TaskService#findAll(com.ketayao.ketacustom.util.dwz.Page)  
	 */
	@Override
	public List<ServiceStatus> findAll(Page page) {
		org.springframework.data.domain.Page<ServiceStatus> springDataPage = serviceStatusDAO.findAll(PageUtils.createPageable(page));
		page.setTotalCount(springDataPage.getTotalElements());
		return springDataPage.getContent();
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.adcc.skyfms.service.TaskService#findByExample(org.springframework.data.jpa.domain.Specification, com.ketayao.ketacustom.util.dwz.Page)	
	 */
	@Override
	public List<ServiceStatus> findByExample(
			Specification<ServiceStatus> specification, Page page) {
		org.springframework.data.domain.Page<ServiceStatus> springDataPage = serviceStatusDAO.findAll(specification, PageUtils.createPageable(page));
		page.setTotalCount(springDataPage.getTotalElements());
		return springDataPage.getContent();
	}
	
	
	 
	
	

	
	
 
}
